feat: Implement update checker functionality#42
Conversation
- Added UpdateChecker class to handle checking for application updates from GitHub releases. - Integrated automatic and manual update checks in the AppController. - Created UpdateNotificationDialog to inform users about available updates. - Added UpdateCheckWorker for background update checking. - Implemented version comparison logic and parsing in UpdateChecker. - Added tests for update checking functionality, including version comparison and API response handling. - Updated UI components to include update check actions in the menu and main window.
There was a problem hiding this comment.
Pull Request Overview
This PR implements a comprehensive update notification system for PhotoSort, enabling both automatic and manual checks for new releases from the GitHub repository. The system automatically checks for updates on startup and provides users with manual update checking through a Help menu option, complete with visual update dialogs and configurable settings.
- Introduced automatic and manual update checking functionality integrated with the application lifecycle
- Added user interface components for update notifications and manual check dialogs
- Implemented background workers for non-blocking update operations and version comparison logic
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_update_checker.py |
Comprehensive test suite for update checking functionality including version comparison, API responses, and platform-specific download URL detection |
src/workers/update_worker.py |
Background worker for non-blocking update checks with Qt signal integration |
src/workers/preview_preloader_worker.py |
Existing preview preloader worker (no functional changes) |
src/ui/worker_manager.py |
Added update check worker management and signals to existing worker infrastructure |
src/ui/update_dialog.py |
New UI dialogs for update notifications and manual check results with drag support |
src/ui/menu_manager.py |
Added "Check for Updates" action to Help menu |
src/ui/main_window.py |
Integrated automatic update check on startup with timer delay |
src/ui/dark_theme.qss |
Added comprehensive styling for update notification dialogs |
src/ui/app_controller.py |
Added update check handlers for both manual and automatic workflows |
src/core/update_checker.py |
Core update checking logic with GitHub API integration and version comparison |
src/core/app_settings.py |
Added update-related settings and GitHub repository configuration |
README.md |
Updated feature list to include update notifications |
DEVELOPER_GUIDE.md |
Added documentation for update system architecture and workers directory |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| import logging | ||
| from PyQt6.QtCore import QObject, pyqtSignal | ||
|
|
||
| from core.update_checker import UpdateChecker |
There was a problem hiding this comment.
Import path is inconsistent with other imports in the file. The import should be from src.core.update_checker import UpdateChecker to match the project structure and be consistent with the test imports.
| from core.update_checker import UpdateChecker | |
| from src.core.update_checker import UpdateChecker |
| import logging | ||
| from PyQt6.QtCore import QObject, pyqtSignal | ||
|
|
||
| from core.image_pipeline import ImagePipeline |
There was a problem hiding this comment.
Import path is inconsistent with project structure. The import should be from src.core.image_pipeline import ImagePipeline to match the expected project layout and be consistent with other imports.
| from core.image_pipeline import ImagePipeline | |
| from src.core.image_pipeline import ImagePipeline |
| patch( | ||
| "src.core.update_checker.get_update_check_enabled", return_value=True | ||
| ), | ||
| patch("core.build_info.VERSION", "dev"), |
There was a problem hiding this comment.
Import path inconsistency. The patches reference core.build_info.VERSION but should be consistent with the project structure. Consider using src.core.build_info.VERSION to match the other imports in the test file.
| patch( | ||
| "src.core.update_checker.get_update_check_enabled", return_value=True | ||
| ), | ||
| patch("core.build_info.VERSION", "dev-abc123"), |
There was a problem hiding this comment.
Import path inconsistency. The patches reference core.build_info.VERSION but should be consistent with the project structure. Consider using src.core.build_info.VERSION to match the other imports in the test file.
| ), | ||
| patch("src.core.update_checker.get_last_update_check_time", return_value=0), | ||
| patch("src.core.update_checker.time.time", return_value=100000), | ||
| patch("core.build_info.VERSION", "1.0.0"), |
There was a problem hiding this comment.
Import path inconsistency. The patches reference core.build_info.VERSION but should be consistent with the project structure. Consider using src.core.build_info.VERSION to match the other imports in the test file.
| "src.core.update_checker.get_last_update_check_time", return_value=99999 | ||
| ), | ||
| patch("src.core.update_checker.time.time", return_value=100000), | ||
| patch("core.build_info.VERSION", "1.0.0"), |
There was a problem hiding this comment.
Import path inconsistency. The patches reference core.build_info.VERSION but should be consistent with the project structure. Consider using src.core.build_info.VERSION to match the other imports in the test file.
This pull request introduces an automatic update notification system to the application, enabling both manual and scheduled checks for new releases from GitHub. It includes core logic for update checking, UI dialogs for update notifications, new settings and constants for update management, and integration with the application's worker and controller layers. Additionally, the developer documentation and README have been updated to reflect these new capabilities.
Update Notification System
src/core/update_checker.pywhich encapsulates all logic for checking updates from GitHub, comparing versions, and parsing release information. Includes robust error handling and platform-specific download URL selection.update_worker.py(documented inDEVELOPER_GUIDE.md) enables non-blocking update checks, managed byWorkerManager.update_dialog.py), providing user feedback on update status.Settings and Configuration
src/core/app_settings.py, including enable/disable flag, last check timestamp, check intervals, and GitHub repo info. Added getter/setter functions for these settings. [1] [2] [3]Application Integration
AppController, with handlers for automatic and manual checks, and UI notification dialogs. Connected worker signals for update completion. [1] [2]QTimerinMainWindow.Documentation and User Communication
README.mdandDEVELOPER_GUIDE.mdto describe the new update notification feature and its integration points. [1] [2]